package company.tree;

/**
 * 树的定义类
 */
public class TreeNode {
    private TreeNode leftTreeNode;//左子树
    private TreeNode rightTreeNode;//右子树
    private int value;//值

    public TreeNode(int value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return "TreeNode{" +
                "leftTreeNode=" + leftTreeNode +
                ", rightTreeNode=" + rightTreeNode +
                ", value=" + value +
                '}';
    }

    public TreeNode getLeft() {
        return leftTreeNode;
    }

    public void setLeft(TreeNode leftTreeNode) {
        this.leftTreeNode = leftTreeNode;
    }

    public TreeNode getRight() {
        return rightTreeNode;
    }

    public void setRight(TreeNode rightTreeNode) {
        this.rightTreeNode = rightTreeNode;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }
}
